<?php
session_start();
//  保存一天
$lifeTime = 30 * 24 * 3600;
setcookie(session_name(), session_id(), time() + $lifeTime, "/");
?>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="https://s1.ax1x.com/2020/07/08/UVG9Te.png" />
    <link rel="bookmark" href="https://s1.ax1x.com/2020/07/08/UVG9Te.png" />
    <title> CoutCin's Nav</title>
    <meta name="description" content="导航网站 含百度,google,必应等搜索引擎集合" />
    <meta name="keywords" content="search, 导航, 书签, 搜索引擎,百度,google,必应 " />

    <!-- <link rel="stylesheet" href="./css/bootstrap.min.css"> -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.6.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/bootstrap-icons.css">
    <link rel="stylesheet" href="./css/common.css">
    <script src="./js/loading.js"></script>
</head>

<body oncontextmenu="return false;">

    <div id="content">
        <div class="login d-flex justify-content-end">
            <?php if (isset($_SESSION['is_login'])) { ?>
                <h5 class="userName bg0 mb-0"><?php echo $_SESSION['name']; ?></h5>&emsp;<button id="logout" class="bg0">退出登陆</button>
            <?php } else { ?>
                <button class="bg0" id="user" data-toggle="modal" data-target="#loginBtn"><i class="bi bi-person"></i> 登陆</button>
            <?php } ?>
        </div>
        <div class="main pb-5">

            <div class="search">
                <div class="row search-header justify-content-center m-0">
                    <div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
                        <div class="btn-group mr-2" role="group" aria-label="First group">
                            <button type="button" id="1" class="btn-my active-btn">Baidu</button>
                            <button type="button" id="2" class="btn-my">Google</button>
                            <button type="button" id="3" class="btn-my">Bing</button>
                            <button type="button" id="4" class="btn-my">搜狗</button>
                        </div>
                    </div>
                    <div class="row search-main  justify-content-center m-0 mt-3">
                        <input type="text" class="search-block border-right-0 bg0" id="values" name="values" autocomplete="off">
                        <button id="searchBtn" class="search-btn bg0"><i class="bi bi-search"></i></button>
                    </div>
                </div>
            </div>
            <div class="funBlock">
                <div class="row" id="funitem">
                    <!-- <div class="col-6 col-sm-6 col-md-4 col-lg-3">
                    <div class="card-my bg3 p-2 block-item">
                        <i class="bi bi-x-circle block-del"></i>
                        <a href="https://www.runoob.com/" class="m-0" target="_blank">菜鸟教程</a>
                    </div>
                </div>
            </div> -->
                </div>
            </div>

            <!-- Login -->
            <div class="modal fade" id="loginBtn" tabindex="-1" aria-labelledby="loginBtn" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title" id="exampleModalLabel">登陆或注册</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">

                            <div class="form-group">
                                <label for="exampleInputEmail1">Username</label>
                                <input type="txt" name="uname" class="form-control" id="name" aria-describedby="emailHelp" autocomplete="off">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputPassword1">Password</label>
                                <input type="password" name="upasswd" class="form-control" id="pass" autocomplete="off">
                            </div>


                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                            <button type="submit" id="login" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- add item-->
            <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title" id="exampleModalLabel">添加标签</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <div class="form-group">
                                <label for="exampleInputEmail1">name</label>
                                <input type="txt" name="names" class="form-control" id="names" aria-describedby="emailHelp" autocomplete="off">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputPassword1">url</label>
                                <input type="text" name="urls" class="form-control" id="urls" autocomplete="off">
                            </div>

                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                            <button type="submit" id="add" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </div>
            </div>

            <div class="position-fixed bottom-0 right-0 p-3" style="z-index: 99999; right: 0; bottom: 0;">
                <div id="liveToast" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true" data-delay="1000">
                    <div class="toast-header">
                        <span id="notice" class="color-green"><i class="bi bi-bell-fill"></i></span>&nbsp;
                        <strong class="mr-auto">CoutCin</strong>&emsp;
                        <small>now</small>
                        <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="toast-body" id="msg">

                    </div>
                </div>
            </div>



        </div>
    </div>
    <!-- <script src="./js/jquery-3.6.0.min.js"></script>
    <script src="./js/bootstrap.min.js"></script> -->
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js"></script>
    <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
    <!-- <script src="./js/popper.min.js"></script> -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.6.0/js/bootstrap.min.js"></script>

    <script src="./js/common.js"></script>
</body>

</html>